package demo.springboot.repo;

import demo.springboot.domain.Book;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Book 数据持久层操作接口
 *
 * Created by bysocket on 09/10/2017.
 */
public interface BookRepository extends JpaRepository<Book, Long> {
    @Query("from Book t")
    List<Book> listAll();

    @Modifying
    @Query("delete from Book t")
    int clearAll();
}
